//////////////////////////////////////////
//
//	FlexInc. 2012
//	http://www.loziosecchi.it/flex_inc
//	http://twitter.com/loziosecchi
//
//////////////////////////////////////////

package flexInc.ane.mobile.calculator
{
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	import flash.external.ExtensionContext;
	
	public class CalculatorLauncher extends EventDispatcher
	{
		private static var extensionContext:ExtensionContext = null;

		/**
		 * Constructor
		 */
		public function CalculatorLauncher(target:IEventDispatcher=null)
		{
			super(target);
			
			if (!extensionContext)
			{
				extensionContext = ExtensionContext.createExtensionContext("flexInc.ane.mobile.CalculatorLauncher", "open");
			}
		}

		/**
		 * Calls the ANE extension to open the calculator
		 * 
		 */
		public function openCalculator():Boolean
		{
			var obj:Object = extensionContext.call("openCalculator");
			
			return obj as Boolean;
		}
	}
}